cc.Class({
    extends: cc.Component,

    properties: {
        _tips_type: 0,
        _label_text: null,
        
        tips_type: {
            get: function () {
                return this._tips_type;
            },
            set: function (value) {
                this._tips_type = value;
            },
        },
        
        label_text: {
            get: function () {
                return this._label_text;
            },
            set: function (value) {
                this._label_text = value;
            },
        },
    },

    onLoad: function () {
        //屏蔽底部点击事件
        cc.find('mask', this.node).on(cc.Node.EventType.TOUCH_START, function (event) {});
        
        switch (this._tips_type) {
            case 1:
                var heidi_2 = cc.find("dikuang/heidi_2", this.node);
                heidi_2.active = false;
                break;
            case 2:
                var quxiao_node = cc.find("dikuang/quxiao", this.node);
                quxiao_node.active = false;
                var queding_node = cc.find("dikuang/queding", this.node);
                queding_node.active = false;
                var heidi_1 = cc.find("dikuang/heidi_1", this.node);
                heidi_1.active = false;
                break;
            default:
                var heidi_2 = cc.find("dikuang/heidi_2", this.node);
                heidi_2.active = false;
                break;
        }
        
        var label_node = cc.find("dikuang/label_text", this.node);
        label_node.getComponent(cc.Label).string = this._label_text;
    },

    //点击确定
    onSure: function () {
        cc.director.loadScene("login_scene", function (err, scene) {
            if (err) {
                cc.warn("lobby_component load login_scene err");
            }
        });
    },
    
    //点击关闭
    onClose: function () {
        this.node.destroy();
    },
});
